package com.kehutong.webchat.entity;

import java.time.LocalDateTime;

import org.coraframework.bean.valid.CheckField;
import org.coraframework.json.annotation.JSONField;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;

import com.kehutong.webchat.enums.WeChatType;

/**
 *
 */
@Table(value="t_setting_wechat", comment="微信应用相关设置")
public class WeChatSetting extends Entity {

	private static final long serialVersionUID = -1319763025330878894L;

	protected WeChatSetting(String id) {
		super(id);
	}

	@CheckField("应用ID不能为空")
	@Column(comment = "应用Id")
	private String appId;

	@CheckField("应用名称不能为空")
	@Column(comment = "应用名称")
	private String name;

	@CheckField("应用密钥不能为空")
	@Column(length = 64, comment = "应用密钥")
	private String appSecret;
	
	@CheckField("应用类型不能为空")
	@Column(comment = "应用类型 [1:公众号, 2:小程序]")
	private WeChatType type;

	@Column(comment = "二维码")
	private String weChatFileId;
	
	@Column(length = 512, comment="access_token")
	private String accessToken;
	
	@Column(comment="accessToken过期时间")
	private LocalDateTime accessTokenExpiredTime;

	@Column(comment = "公司编号")
	private String companyNo;

	@Column(comment = "公司名称")
	private String companyName;

	@JSONField(serialize = false)
	@Column(comment = "逻辑删除")
	private boolean deleted;

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getAppSecret() {
		return appSecret;
	}

	public void setAppSecret(String appSecret) {
		this.appSecret = appSecret;
	}

	public String getWeChatFileId() {
		return weChatFileId;
	}

	public void setWeChatFileId(String weChatFileId) {
		this.weChatFileId = weChatFileId;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public LocalDateTime getAccessTokenExpiredTime() {
		return accessTokenExpiredTime;
	}

	public void setAccessTokenExpiredTime(LocalDateTime accessTokenExpiredTime) {
		this.accessTokenExpiredTime = accessTokenExpiredTime;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public WeChatType getType() {
		return type;
	}

	public void setType(WeChatType type) {
		this.type = type;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public String getCompanyNo() {
		return companyNo;
	}

	public void setCompanyNo(String companyNo) {
		this.companyNo = companyNo;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
}
